﻿Imports NHibernate
Imports NHibernate.Criterion
Imports TodoMicroSolutionPackV1.productos.dal.dto
Imports TodoMicroSolutionPackV1.dal.dao
Namespace productos.dal.dao
    Public Class stockDAO
        Inherits GenericNHibernateDAO(Of stock, Integer)
        Public Sub New(ByRef session As ISession)
            MyBase.New(session)
        End Sub
        Public Function getStocks(ByRef producto As producto, ByVal deposito_id As Integer)
            Dim criteria As ICriteria = session.CreateCriteria(Of stock)()
            criteria.Add(Expression.Eq("producto", producto))
            criteria.Add(Expression.Eq("deposito_id", deposito_id))
            criteria.Add(Expression.Gt("cantidad", 0.0))
            Return criteria.List
        End Function
    End Class
End Namespace

